/**
 * Company : Thai Informatic System Co., Ltd.
 * Created By : Dr.Tree
 * Created On : May 12, 2012  11:12:23 AM 
 * e-Mail : chatree@tis.co.th
 * Mobile Phone : (+66) 087-921-5115
 * Package Name : apps.business.process.sales.booking
 * File Name : SalesBookingSingleProcessing.java
 * TODO
 */
package apps.business.process.sales.booking;

import java.util.List;

import jpa.entitys.promis.sales.VwSyncMktCustBookCont;
import jpa.entitys.synchro.staging.FiArreceiptreOutb;
import jpa.entitys.synchro.staging.PsWbsMaster;
import jpa.entitys.synchro.staging.SdBookContrOutb;
import jpa.entitys.synchro.staging.SdChargecode;
import jpa.service.promis.sales.VwSyncMktCustBookContServices;

import org.apache.log4j.Logger;

import promis.utility.CommonService;

import apps.promis.out.common.PropertyUnitAction;
import apps.promis.out.common.VwSyncRcvdInstallmentAction;
import apps.promis.out.sales.ReceiptedChargeCodeAction;
import apps.promis.out.sales.VwSyncMktBookConstructionAction;

import sap.business.fi.outbound.FiArreceiptreOutbService;
import sap.business.ps.outbound.PsWbsMasterService;
import sap.business.sd.outbound.SdChargecodeService;
import sap.business.sd.outbound.VwSyncMktCustBookContService;

/**
 * @author chatree
 *
 */
public class SalesBookingSingleProcessing {
	
	private static final Logger log = Logger.getLogger(SalesBookingSingleProcessing.class);

	/**
	 * 
	 */
	public SalesBookingSingleProcessing() {
		// TODO Auto-generated constructor stub
	}
	
	/**
	 * 		//Sales Booking /////////////////////////////////////////
			String company = "SP";
			String project = "SPLVILLE-PRAGSA"; //SPLCITY-SRI
			String BookingOrContarctNo = "BS-1206-000025"; //  "CS-1204-000009-0" // "BS-1204-000007"; //BS-1204-000016			
			String status = "X";
			String syncIsstaging = null; //Can set value to [null]
			String issync = "N";
	 * @param company
	 * @param project
	 * @param BookingOrContarctNo
	 * @param status
	 * @param syncIsstaging
	 * @param issync
	 * @throws Exception
	 */
	public void Processing(String company, String project, String BookingOrContarctNo, String status, String syncIsstaging, String issync) throws Exception {
		try{

			new SalesBookingProcessing().newProcessingSingle(company, project, BookingOrContarctNo, status, syncIsstaging, issync);
			
		}catch(Exception e)
		{
			log.error(e.getMessage());
			System.err.println(e.getMessage());
			e.printStackTrace();
			throw e;
		}
	}
	
	public void ProcessingForRMS(String company, String project, String BookingOrContarctNo, String status, String syncIsstaging, String issync) throws Exception {
		try{

			new SalesBookingProcessing().newProcessingSingleForRMS(company, project, BookingOrContarctNo, status, syncIsstaging, issync);
			
		}catch(Exception e)
		{
			log.error(e.getMessage());
			System.err.println(e.getMessage());
			throw e;
		}
	}

	@Deprecated
	private void  Start() throws Exception {
		try{
			SalesBookingProcessing obj = new SalesBookingProcessing();

			//Sales Booking /////////////////////////////////////////
			String company = "SP";
			String project = "SPLVILLE-PRAGSA"; //SPLCITY-SRI
			String BookingOrContarctNo = "BS-1206-000025"; //  "CS-1204-000009-0" // "BS-1204-000007"; //BS-1204-000016			
			String status = "X";
			String syncIsstaging = null; //Can set value to [null]
			String issync = "N";
			
			
			obj.newProcessingSingle(company, project, BookingOrContarctNo, status, syncIsstaging, issync);
			
		}catch(Exception e)
		{
			log.error(e.getMessage());
			System.err.println(e.getMessage());
			throw e;
		}
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		
		try{
			
			new SalesBookingSingleProcessing().Start();
			
		}catch(Exception e)
		{
			log.error(e.getMessage());
			System.err.println(e.getMessage());
		}
	}

}
